package com.wangsb.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

/**
 * @Description: TODO
 * @author: shenbing.wang@hand-china
 * @date: 2021年02月23日 23:11
 */
@Controller
public class InterceptorController {

    @RequestMapping("/test01")
    public String test01() {
        System.out.println("请求方法执行中");
        return "admin";
    }


    @GetMapping("/login")
    public String login() {
        System.out.println("登陆中。。。");
        return "login";
    }

    @PostMapping("/login")
    public String admin(HttpSession session) {
        session.setAttribute("username", "wangshenbing");
        System.out.println("登陆成功");
        return "admin";
    }
}
